#include <iostream>
#include <functional>

using namespace std;

template<typename T>
void func(T a)
{
    ++a;
}

int main()
{
    int a = 0, b = 0;
    func(a);                        // a以值类型传递，调用func后值不变
    cout << "a = " << a << endl;
    func(ref(b));                   // b以引用类型传递，调用后+1
    cout << "b = " << b << endl;
}